<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>WELCOME TO FILE MANAGER!!!</title>
</head>
<body>
<%@ page import="file_functions.*, java.io.*" %>
<%
String source = new String((byte[])session.getAttribute("dir"), "UTF8");
session.setAttribute("dir", null);
String destination = new String((byte[])session.getAttribute("displace"), "UTF8");
	session.setAttribute("displace", null);
	
	byte[][] byt = (byte[][])session.getAttribute("list");
	session.setAttribute("list", null);
	
	String[] list = new String[byt.length];
	boolean total_res = true;
	
	for (int i = 0; i < byt.length; i++)
	{
		list[i] = new String (byt[i], "UTF8");
		Manager man = new Manager(null);
		boolean result = man.displace(source, destination, list[i]);
		if (!result)
		{
			total_res = false;
			out.println("<br>Error occured with "+list[i]+" in "+source);
		}
	}
	if (total_res)
		out.println("<br>SUCCESSFUL DISPLACING");
%>
<br>
<a href = "main.jsp">back to manager</a>
</body>
</html>